package Common.Entities;

/**
 * This Enum enumerates an entity status:
 * Possible statuses are:
 * ACTIVE, NOT_ACTIVE, SUSPENDED
 *  
 * @author ori ziv
 *
 */
public enum STATUS {
	ACTIVE,
	NOT_ACTIVE,
	SUSPENDED;
	
	/**
	 * This method translates STSTUS enum to int
	 * @param status
	 * @return - ACTIVE = 1, NOT_ACTIVE = 2, SUSPENDED = 3, unknown = -1
	 */
	public static int toInt(STATUS status) {
		switch (status) {
		case ACTIVE:
			return 1;
		case NOT_ACTIVE:
			return 2;
		case SUSPENDED:
			return 3;
		}
		return -1;
	}

	/**
	 * This method translates STSTUS enum to string
	 * @param status
	 * @return - A string that describes status value or null if unknown
	 */
	public static String toString(STATUS status) {
		switch (status) {
		case ACTIVE:
			return "ACTIVE";
		case NOT_ACTIVE:
			return "NOT ACTIVE";
		case SUSPENDED:
			return "SUSPENDED";
		}
		return null;
	}
}
